package homework;

public class Triangle extends Shape {

	protected double firstEdge;
	protected double secondEdge;
	protected double thirdEdge;
	
	public Triangle() {
		this.type="三角形";
	}
	
	public void calculate() {
		double p=(firstEdge+secondEdge+thirdEdge)/2;
	    this.area=Math.sqrt(p*(p-firstEdge)*(p-secondEdge)*(p-thirdEdge));
	}
	
	public void description() {
		System.out.println(this.type+"的三边长为："+this.firstEdge+","+this.secondEdge+","+this.thirdEdge);
		this.show();
	}
}
